<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>试题详情</title>
    <link rel="stylesheet" href="/static/resources/bootstrap/css/bootstrap.css"/>
    <link href="/static/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="/static/resources/css/style.css" rel="stylesheet">
    <!-- Javascript files -->
    <!-- jQuery -->
    <script type="text/javascript" src="/static/resources/js/jquery/jquery-3.1.1.min.js"></script>
    <!--VUE-->
    <script type="text/javascript" src="/static/resources/vue/vue.js"></script>
    <script type="text/javascript" src="/static/resources/vue/date.js"></script>
    <!-- Bootstrap JS -->
    <script type="text/javascript" src="/static/resources/bootstrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/static/resources/layui/layui.all.js"></script>

</head>
<body>
<div style=" margin-right: 100px" id="app">

    <form role="form" id="detailForm" class="form-horizontal">
        <div style="margin-left: 50px">
        <a href="/questionDetail?href=question-upd&id=${question.id}">
            <button type="button" class="btn btn-info" aria-label="Left Align" style="margin: 20px">
                <span class="glyphicon glyphicon-edit" aria-hidden="true"></span> 修改试题
            </button>
        </a>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">题目</label>
            <div class="col-sm-10">
                <p class="form-control-static">${question.name}</p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">题目类型</label>
            <div class="col-sm-10">
                <p class="form-control-static">${question.questionType.name}</p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">题库</label>
            <div class="col-sm-10">
                <p class="form-control-static">${question.field.fieldName}</p>
            </div>
        </div>
        <div class="form-group">
            <h5><label class="col-sm-2 control-label">知识点</label>
            <div class="col-sm-10">
                <p class="form-control-static">
                    <#list question.pointList as point>
                        <span class="label label-info" style="margin: 10px">${point.pointName}</span>
                    </#list>
                </p>
            </div>
            </h5>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">创建时间</label>
            <div class="col-sm-10">
                <p class="form-control-static">
                ${question.createTime?string("yyyy-MM-dd HH:mm:ss")}
                </p>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">创建人</label>
            <div class="col-sm-10">
                <p class="form-control-static">
                    ${question.creator}
                </p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">最后修改时间</label>
            <div class="col-sm-10">
                <p class="form-control-static">
                    <#if question.lastModify??>
                        ${question.lastModify?string("yyyy-MM-dd HH:mm:ss")}
                    </#if>
                </p>
            </div>
        </div>
        <div id="questionBody">

        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">答案</label>
            <div class="col-sm-10">
                <p class="form-control-static">
                ${question.answer}
                </p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">试题解析</label>
            <div class="col-sm-10">
                <p class="form-control-static">
                    ${question.analysis}
                </p>
            </div>
        </div>
    </form>
</div>
</body>
</html>
<script>
    $(function () {
        var answer='${question.answer}';
        console.log(answer);
        if(answer!="T" && answer!="F"){
            var questionBody='<div class="form-group">\n' +
                    '                                <label class="col-sm-2 control-label">选项</label>\n' +
                    '                                <div class="col-sm-10">\n' +
                    '                                    <p class="form-control-static">A: ${question.a}</p>\n' +
                    '                                    <p class="form-control-static">B: ${question.b}</p>\n' +
                    '                                    <p class="form-control-static">C: ${question.c}</p>\n' +
                    '                                    <p class="form-control-static">D: ${question.d}</p>\n' +
                    '                               </div>\n' +
                    '                            </div>'
            $("#questionBody").append(questionBody);
        }

    })
</script>